﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TongTongMall.Extensions;

namespace TongTongMall.Redis.Cache
{
    public static class RedisCommands
    {
        public readonly static string Quit = "QUIT";
        public readonly static string Auth = "AUTH";
        public readonly static string Exists = "EXISTS";
        public readonly static string Del = "DEL";
        public readonly static string Type = "TYPE";
        public readonly static string Keys = "KEYS";
        public readonly static string RandomKey = "RANDOMKEY";
        public readonly static string Rename = "RENAME";
        public readonly static string RenameNx = "RENAMENX";
        public readonly static string PExpire = "PEXPIRE";
        public readonly static string PExpireAt = "PEXPIREAT";
        public readonly static string DbSize = "DBSIZE";
        public readonly static string Expire = "EXPIRE";
        public readonly static string ExpireAt = "EXPIREAT";
        public readonly static string Ttl = "TTL";
        public readonly static string PTtl = "PTTL";
        public readonly static string Select = "SELECT";
        public readonly static string FlushDb = "FLUSHDB";
        public readonly static string FlushAll = "FLUSHALL";
        public readonly static string Ping = "PING";
        public readonly static string Echo = "ECHO";

        public readonly static string Save = "SAVE";
        public readonly static string BgSave = "BGSAVE";
        public readonly static string LastSave = "LASTSAVE";
        public readonly static string Shutdown = "SHUTDOWN";
        public readonly static string NoSave = "NOSAVE";
        public readonly static string BgRewriteAof = "BGREWRITEAOF";

        public readonly static string Info = "INFO";
        public readonly static string SlaveOf = "SLAVEOF";
        public readonly static string No = "NO";
        public readonly static string One = "ONE";
        public readonly static string ResetStat = "RESETSTAT";
        public readonly static string Rewrite = "REWRITE";
        public readonly static string Time = "TIME";
        public readonly static string Segfault = "SEGFAULT";
        public readonly static string Sleep = "SLEEP";
        public readonly static string Dump = "DUMP";
        public readonly static string Restore = "RESTORE";
        public readonly static string Migrate = "MIGRATE";
        public readonly static string Move = "MOVE";
        public readonly static string Object = "OBJECT";
        public readonly static string IdleTime = "IDLETIME";
        public readonly static string Monitor = "MONITOR";		//missing
        public readonly static string Debug = "DEBUG";			//missing
        public readonly static string Config = "CONFIG";			//missing
        public readonly static string Client = "CLIENT";
        public readonly static string List = "LIST";
        public readonly static string Kill = "KILL";
        public readonly static string Addr = "ADDR";
        public readonly static string Id = "ID";
        public readonly static string SkipMe = "SKIPME";
        public readonly static string SetName = "SETNAME";
        public readonly static string GetName = "GETNAME";
        public readonly static string Pause = "PAUSE";
        public readonly static string Role = "ROLE";
        //public readonly static string Get = "GET";
        //public readonly static string Set = "SET";

        public readonly static string StrLen = "STRLEN";
        public readonly static string Set = "SET";
        public readonly static string Get = "GET";
        public readonly static string GetSet = "GETSET";
        public readonly static string MGet = "MGET";
        public readonly static string SetNx = "SETNX";
        public readonly static string SetEx = "SETEX";
        public readonly static string Persist = "PERSIST";
        public readonly static string PSetEx = "PSETEX";
        public readonly static string MSet = "MSET";
        public readonly static string MSetNx = "MSETNX";
        public readonly static string Incr = "INCR";
        public readonly static string IncrBy = "INCRBY";
        public readonly static string IncrByFloat = "INCRBYFLOAT";
        public readonly static string Decr = "DECR";
        public readonly static string DecrBy = "DECRBY";
        public readonly static string Append = "APPEND";
        public readonly static string GetRange = "GETRANGE";
        public readonly static string SetRange = "SETRANGE";
        public readonly static string GetBit = "GETBIT";
        public readonly static string SetBit = "SETBIT";
        public readonly static string BitCount = "BITCOUNT";

        public readonly static string Scan = "SCAN";
        public readonly static string SScan = "SSCAN";
        public readonly static string HScan = "HSCAN";
        public readonly static string ZScan = "ZSCAN";
        public readonly static string Match = "MATCH";
        public readonly static string Count = "COUNT";

        public readonly static string PfAdd = "PFADD";
        public readonly static string PfCount = "PFCOUNT";
        public readonly static string PfMerge = "PFMERGE";

        public readonly static string RPush = "RPUSH";
        public readonly static string LPush = "LPUSH";
        public readonly static string RPushX = "RPUSHX";
        public readonly static string LPushX = "LPUSHX";
        public readonly static string LLen = "LLEN";
        public readonly static string LRange = "LRANGE";
        public readonly static string LTrim = "LTRIM";
        public readonly static string LIndex = "LINDEX";
        public readonly static string LInsert = "LINSERT";
        public readonly static string Before = "BEFORE";
        public readonly static string After = "AFTER";
        public readonly static string LSet = "LSET";
        public readonly static string LRem = "LREM";
        public readonly static string LPop = "LPOP";
        public readonly static string RPop = "RPOP";
        public readonly static string BLPop = "BLPOP";
        public readonly static string BRPop = "BRPOP";
        public readonly static string RPopLPush = "RPOPLPUSH";
        public readonly static string BRPopLPush = "BRPOPLPUSH";

        public readonly static string SAdd = "SADD";
        public readonly static string SRem = "SREM";
        public readonly static string SPop = "SPOP";
        public readonly static string SMove = "SMOVE";
        public readonly static string SCard = "SCARD";
        public readonly static string SIsMember = "SISMEMBER";
        public readonly static string SInter = "SINTER";
        public readonly static string SInterStore = "SINTERSTORE";
        public readonly static string SUnion = "SUNION";
        public readonly static string SUnionStore = "SUNIONSTORE";
        public readonly static string SDiff = "SDIFF";
        public readonly static string SDiffStore = "SDIFFSTORE";
        public readonly static string SMembers = "SMEMBERS";
        public readonly static string SRandMember = "SRANDMEMBER";

        public readonly static string ZAdd = "ZADD";
        public readonly static string ZRem = "ZREM";
        public readonly static string ZIncrBy = "ZINCRBY";
        public readonly static string ZRank = "ZRANK";
        public readonly static string ZRevRank = "ZREVRANK";
        public readonly static string ZRange = "ZRANGE";
        public readonly static string ZRevRange = "ZREVRANGE";
        public readonly static string ZRangeByScore = "ZRANGEBYSCORE";
        public readonly static string ZRevRangeByScore = "ZREVRANGEBYSCORE";
        public readonly static string ZCard = "ZCARD";
        public readonly static string ZScore = "ZSCORE";
        public readonly static string ZCount = "ZCOUNT";
        public readonly static string ZRemRangeByRank = "ZREMRANGEBYRANK";
        public readonly static string ZRemRangeByScore = "ZREMRANGEBYSCORE";
        public readonly static string ZUnionStore = "ZUNIONSTORE";
        public readonly static string ZInterStore = "ZINTERSTORE";
        public static readonly string ZRangeByLex = "ZRANGEBYLEX";
        public static readonly string ZLexCount = "ZLEXCOUNT";
        public static readonly string ZRemRangeByLex = "ZREMRANGEBYLEX";

        public readonly static string HSet = "HSET";
        public readonly static string HSetNx = "HSETNX";
        public readonly static string HGet = "HGET";
        public readonly static string HMSet = "HMSET";
        public readonly static string HMGet = "HMGET";
        public readonly static string HIncrBy = "HINCRBY";
        public readonly static string HIncrByFloat = "HINCRBYFLOAT";
        public readonly static string HExists = "HEXISTS";
        public readonly static string HDel = "HDEL";
        public readonly static string HLen = "HLEN";
        public readonly static string HKeys = "HKEYS";
        public readonly static string HVals = "HVALS";
        public readonly static string HGetAll = "HGETALL";

        public readonly static string Sort = "SORT";

        public readonly static string Watch = "WATCH";
        public readonly static string UnWatch = "UNWATCH";
        public readonly static string Multi = "MULTI";
        public readonly static string Exec = "EXEC";
        public readonly static string Discard = "DISCARD";

        public readonly static string Subscribe = "SUBSCRIBE";
        public readonly static string UnSubscribe = "UNSUBSCRIBE";
        public readonly static string PSubscribe = "PSUBSCRIBE";
        public readonly static string PUnSubscribe = "PUNSUBSCRIBE";
        public readonly static string Publish = "PUBLISH";


        public readonly static string WithScores = "WITHSCORES";
        public readonly static string Limit = "LIMIT";
        public readonly static string By = "BY";
        public readonly static string Asc = "ASC";
        public readonly static string Desc = "DESC";
        public readonly static string Alpha = "ALPHA";
        public readonly static string Store = "STORE";

        public readonly static string Eval = "EVAL";
        public readonly static string EvalSha = "EVALSHA";
        public readonly static string Script = "SCRIPT";
        public readonly static string Load = "LOAD";
        //public readonly static string Exists = "EXISTS";
        public readonly static string Flush = "FLUSH";
        public readonly static string Slowlog = "SLOWLOG";

        public readonly static string Ex = "EX";
        public readonly static string Px = "PX";
        public readonly static string Nx = "NX";
        public readonly static string Xx = "XX";

        // Sentinel commands
        public readonly static string Sentinel = "SENTINEL";
        public readonly static string Masters = "masters";
        public readonly static string Sentinels = "sentinels";
        public readonly static string Master = "master";
        public readonly static string Slaves = "slaves";
        public readonly static string Failover = "failover";
        public readonly static string GetMasterAddrByName = "get-master-addr-by-name";

        //Geo commands
        public readonly static string GeoAdd = "GEOADD";
        public readonly static string GeoDist = "GEODIST";
        public readonly static string GeoHash = "GEOHASH";
        public readonly static string GeoPos = "GEOPOS";
        public readonly static string GeoRadius = "GEORADIUS";
        public readonly static string GeoRadiusByMember = "GEORADIUSBYMEMBER";

        public readonly static string WithCoord = "WITHCOORD";
        public readonly static string WithDist = "WITHDIST";
        public readonly static string WithHash = "WITHHASH";
    }
}
